package com.flmes.base.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @Author: flmes
 * @Date: 2024/10/9 20:56
 */
@Data
@Component
@Validated
@ConfigurationProperties(prefix = "flmes")
public class FlmesConfig {

    /**
     * 授权相关
     */
    private final Auth auth = new Auth();

    @Data
    public static class Auth {

        /**
         * 生成token密钥(64位16进制字符)
         */
        @NotBlank
        private String secret;
        /**
         * token有效期(小时)
         */
        @NotNull
        private Integer expired;
    }

}
